package com.wujing.abstractdemo

/**
 * 匿名子类
 */
object NoNameDemo01 {
  def main(args: Array[String]): Unit = {
    var obj=new Monster2 {
      override var name: String = "String  "

      override def cry(): Unit = {
        println(this.name)
      }
    }
    obj.cry()


  }
}

abstract class Monster2{
  var name:String
  def cry()
}